1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| import bpy import numpy as np import os
bpy.ops.object.text_add() text_obj = bpy.context.object
text_obj.rotation_euler[0] = np.pi / 2 text_obj.rotation_euler[2] = np.pi / 2 text_obj.data.align_x = "CENTER" text_obj.data.align_y = "CENTER" text_obj.data.space_line = 1.2
text_obj.data.extrude = 0.02
text_obj.data.body = "BARBEQUE\nNATION" font_path = os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(bpy.data.filepath)) , './fonts/Neon_Future.ttf')) text_obj.data.font = bpy.data.fonts.load(font_path)
text_material = bpy.data.materials.new(name="Emission") text_material.use_nodes = True nodes = text_material.node_tree.nodes
for node in nodes: nodes.remove(node)
emission_node = nodes.new(type='ShaderNodeEmission') emission_node.inputs[0].default_value = (0.25, 1, 0.325, 1) emission_node.inputs[1].default_value = 4
output_node = nodes.new(type='ShaderNodeOutputMaterial') links = text_material.node_tree.links links.new(emission_node.outputs[0], output_node.inputs[0])
text_obj.data.materials.append(text_material)
bpy.context.scene.eevee.use_bloom = True bpy.context.scene.eevee.bloom_radius = 3 bpy.context.scene.eevee.bloom_color = (0.25, 1, 0.325) bpy.context.scene.eevee.bloom_intensity = 0.25
bpy.ops.mesh.primitive_plane_add() plane_obj = bpy.context.object plane_obj.rotation_euler[1] = np.pi / 2 plane_obj.scale[0] = 2.5 plane_obj.scale[1] = 3.5 plane_obj.location[0] = -0.25
plane_material = bpy.data.materials.new(name="Wall") plane_material.use_nodes = True nodes = plane_material.node_tree.nodes
image_texture_node = nodes.new(type='ShaderNodeTexImage') image_texture_node.image = bpy.data.images.load(os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(bpy.data.filepath)) , './texture/Wall.jpg'))) mapping_node = nodes.new(type='ShaderNodeMapping') mapping_node.inputs[2].default_value[2] = np.pi / 2
texcoord_node = nodes.new(type="ShaderNodeTexCoord")
links = plane_material.node_tree.links links.new(texcoord_node.outputs[0], mapping_node.inputs[0]) links.new(mapping_node.outputs[0], image_texture_node.inputs[0]) links.new(image_texture_node.outputs[0], nodes["Principled BSDF"].inputs[0])
plane_obj.data.materials.append(plane_material)
bpy.ops.object.lightprobe_add(type="GRID") lightprobe_obj = bpy.context.object lightprobe_obj.scale[0:3] = [1, 3.5, 2]
bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[1].default_value = 0 bpy.context.scene.eevee.use_ssr = True
light_obj_list = [] for i in range(8): bpy.ops.object.light_add(type="POINT") light_obj_list.append(bpy.context.object) light_obj_list[-1].data.color = (0.25, 1, 0.325) if i < 5: light_obj_list[-1].location[1] = -2 + i light_obj_list[-1].location[2] = 0.5 else: light_obj_list[-1].location[1] = -6 + i light_obj_list[-1].location[2] = -0.5
|